#include "app_lis2dh12.h"
#include "x_nucleo_iks01a1.h"

/*private function*/
/*private variable*/

APP_LIS2DH12_StatusTypeDef app_lis2dh12_check_id(void)
{
     uint8_t id;
     if(LIS2DH12_Read_Id(&id) != APP_LIS2DH12_OK)
         return APP_LIS2DH12_ERROR;
     
     if(id != I_AM_LIS2DH12)
         return APP_LIS2DH12_ERROR;
     
     return APP_LIS2DH12_OK;
}

APP_LIS2DH12_StatusTypeDef app_lis2dh12_powerdown(void)
{

     if(LIS2DH12_FIFO_Mode_Set(LIS2DH12_FIFO_MODE_BYPASS) != LIS2DH12_OK)
         return APP_LIS2DH12_ERROR;
     /*ODR set*/
     if(LIS2DH12_Data_Rate_Set(LIS2DH12_POWER_DOWN) != APP_LIS2DH12_OK)
         return APP_LIS2DH12_ERROR;
      /*x , y, z disable*/
     if(LIS2DH12_Axis_Enable(LIS2DH12_AXIS_DISABLE)!= APP_LIS2DH12_OK)
         return APP_LIS2DH12_ERROR;
//  
//     if(app_lis2dh12_check_id() != APP_LIS2DH12_OK)
//         return APP_LIS2DH12_ERROR;
     
     return APP_LIS2DH12_OK;
}

